package com.solution.admin.customer.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.solution.admin.customer.dao.CustomerCustomFieldDao;
import com.solution.admin.customer.entity.CustomerCustomFieldEntity;
import com.solution.admin.customer.service.CustomerCustomFieldService;

import com.solution.common.dao.BaseDao;
import com.solution.common.page.PageBean;
import com.solution.common.page.PageParam;
import com.solution.common.service.impl.BaseServiceImpl;
import com.solution.common.utils.string.StringUtil;

/**
 * 客户属性自定义service实现层
 * @author solin
 * @date 2017-09-27 09:19:24
 */
@Service
public class CustomerCustomFieldServiceImpl extends BaseServiceImpl<CustomerCustomFieldEntity> implements CustomerCustomFieldService {

	/**
	 * 客户属性自定义接口
	 */
	@Autowired
	private CustomerCustomFieldDao customerCustomFieldDao;

	protected BaseDao<CustomerCustomFieldEntity> getDao() {
		return this.customerCustomFieldDao;
	}

	/**
	 * 保存客户属性自定义
	 * @param customerCustomFieldEntity 客户属性自定义实体
	 * @return Long 添加成功客户属性自定义的ID
	 * @author solin
	 * @date 2017-09-27 09:19:24
	 */
	public long saveCustomerCustomField(CustomerCustomFieldEntity customerCustomFieldEntity) {
		return customerCustomFieldDao.saveCustomerCustomField(customerCustomFieldEntity);
	}

	/**
	 * 分页查询客户属性自定义
	 * @param pageParam 分页参数
	 * @param paramMap 查询参数
	 * @return PageBean 分页参数和分页数据
	 * @author solin
	 * @date 2017-09-27 09:19:24
	 */
	@Override
	public PageBean listCustomerCustomFieldPage(PageParam pageParam, Map<String, Object> paramMap) {
		return customerCustomFieldDao.listCustomerCustomFieldPage(pageParam, paramMap);
	}
	
	/**
	 * 根据ID查询用户信息
	 * @param id 用户id
	 * @return customerCustomFieldEntity 用户对象
	 * @author solin
	 * @date 2017-09-27 09:19:24
	 */
	public CustomerCustomFieldEntity getCustomerCustomFieldById(Long id) {
		return customerCustomFieldDao.getById(id.longValue());
	}

	/**
	 * 更新用户
	 * @param customerCustomFieldEntity 用户实体
	 * @return Long 更新是否成功，>1代表更新成功
	 * @author solin
	 * @date 2017-09-27 09:19:24
	 */
	@Override
	public int updateCustomerCustomField(CustomerCustomFieldEntity customerCustomFieldEntity) {
		return customerCustomFieldDao.updateCustomerCustomField(customerCustomFieldEntity);
	}
	
	
	/**
	 * 根据条件查询客户属性自定义
	 * @param param
	 * @return 数据列表
	 * @author solin
	 * @date 2017-09-27 09:19:24
	 */
	@Override
	public List<CustomerCustomFieldEntity> listCustomerCustomField( Map<String, Object> param){
		return  customerCustomFieldDao.listCustomerCustomField(param);
	}
	
	/**
	 * 删除客户属性自定义
	 * @param 
	 * @return int 返回删除记录条数
	 * @author solin
	 * @date 2017-09-27 09:19:24
	 */
	public int deleteCustomerCustomFieldById(long id){
		return  customerCustomFieldDao.deleteById(id);
	}
	
}
